{extend name="layout/layout" /} {block name="title"}全国布局——楼氏集团{/block}
{block name="container"}
<!-- Banner -->
<div class="banner">
  <img class="lazy-img" data-src="{$banner}" alt="" />
</div>

<!-- layout -->
<section class="section bg-white layout-section">
  <div class="container">
    <div class="title-box">
      <h1>LAYOUT<br />全国事业部布局</h1>
    </div>

    <div class="map-box">
      <img class="big" src="/template/assets/images/map_layout_bg.jpg" alt="" />
      <img
        class="small"
        src="/template/assets/images/map_layout_bg_m.jpg"
        alt=""
      />
      <ul>
        <?php foreach($recommends as $v): ?>
        <li>
          <h2><?php echo $v['position']; ?></h2>
          <p><?php echo $v['description']; ?></p>
        </li>
        <?php endForeach; ?>
      </ul>
    </div>
    <ul class="map-list">
      <?php foreach($onlines as $v): ?>
      <li>
        <div class="map-content">
          <h2><?php echo $v['area']; ?></h2>
          <h3>地址</h3>
          <p><?php echo $v['address']; ?></p>
          <h3>联系电话</h3>
          <p><?php echo $v['username']; ?>：<?php echo $v['mobile']; ?></p>
          <h3>邮箱</h3>
          <p><?php echo $v['email']; ?></p>
        </div>
        <a href="<?php echo $v['url'] ?: 'javascript:;' ?>" class="map-img" target="_blank">
          <img class="lazy-img" data-src="<?php echo $v['image']; ?>" />
        </a>
      </li>
      <?php endForeach; ?>
    </ul>
  </div>
</section>

<!-- Core -->
<section class="section core-section bg-white">
  <div class="container">
    <div class="title-box">
      <h1>CORE<br />核心人员</h1>
    </div>

    <div class="core-box">
      <?php foreach($cores as $v): ?>
      <a class="core-item">
        <img
          class="lazy-img"
          data-src="<?php echo $v['avatar']; ?>"
          alt="<?php echo $v['username']; ?>"
        />
        <div class="core-content">
          <h2>
            <mark><?php echo $v['username']; ?></mark>
          </h2>
          <span><?php echo $v['position']; ?></span>
        </div>
      </a>
      <?php endForeach; ?>
    </div>
  </div>
</section>

<!-- Star -->
<section class="section star-section bg-white">
  <div class="container">
    <div class="title-box">
      <h1>LOUSHI STAR<br />楼氏之星</h1>
    </div>

    <div class="star-box">
      <div class="star-box_hd">
        <ul class="star-sort-bar">
          <?php foreach($years as $y): ?>
          <li class="<?php if($y == $now) { echo 'active'; }?>">
            <a
              href="javascript:;"
              data-id="<?php echo $y; ?>"
              onclick="year(this)"
              ><?php echo $y; ?></a
            >
          </li>
          <?php endForeach; ?>
        </ul>
      </div>
      <?php foreach($stars as $key=>$star): ?>
      <div
        class="star-box_bd <?php if($key != $now){ echo 'star'; } ?>"
        id="star-<?php echo $key; ?>"
      >
        <?php foreach($star as $k=>$val): ?>
        <div class="star-list">
          <?php foreach($val as $v): ?>
          <a class="star-item" data-text="<?php echo $k; ?>">
            <div class="star-avatar">
              <img class="lazy-img" data-src="<?php echo $v['avatar']; ?>" />
            </div>
            <div class="star-content">
              <h2>
                <mark><?php echo $v['username']; ?></mark>
              </h2>
              <span><?php echo $v['description']; ?></span>
            </div>
          </a>
          <?php endForeach; ?>
        </div>
        <?php endForeach; ?>
      </div>
      <?php endforeach; ?>
    </div>
  </div>
</section>

<script>
  //楼氏之星切换
  function year(obj) {
    //追加class
    $(".star-box .star-sort-bar li").removeClass("active");
    $(obj).parent().addClass("active");
    //显示
    var id = $(obj).data("id");
    $(".star-box .star-box_bd").addClass("star");
    $(`#star-${id}`).removeClass("star");
  }
</script>

{/block}
